package cn.yundian.controller;


import cn.yundian.dao.GirRspo;
import cn.yundian.pojo.Girl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class FirstController {


    @RequestMapping("/hello")
    public String say() {

        return "hello world";
    }

    @Autowired
    private GirRspo girRspo;


    @RequestMapping("/girls")
    public List<Girl> queryAll() {
        return girRspo.findAll();


    }


    public static void main(String[] args) {


        System.out.println("你好");


    }


    @RequestMapping("/girs")
    public Girl AddGirl() {

        Girl girl = new Girl();

        girl.setId(2);
        girl.setAge(99);
        girl.setName("zhouzj");

        return girRspo.save(girl);

    }
}
